package org.jeecg.modules.simulator.rooter;

import org.jeecg.modules.simulator.loader.StationAddPersonNumData;
import org.jeecg.modules.simulator.model.line.station.station.Station;
import org.jeecg.modules.simulator.util.UnitCache;

public class StationChecker {
    String sceneCode;



//检查进站的是否有外来新增人数
public int checkAndAddPerson(String now, Station station, int vsize) {
        StationAddPersonNumData stationAddPersonNumData = UnitCache.stationAddPersonNumDataMap.get(sceneCode);
        if (stationAddPersonNumData == null) {
            return vsize;
        }
        String addTimePoint = stationAddPersonNumData.getAddTimePoint();

        if (stationAddPersonNumData.getStationName().equals(station.getName()) && now.equals(addTimePoint)) {
            if (station.isTransferStation()) {//换乘站人员分配
                vsize += (int) stationAddPersonNumData.getAddPersonNum() / 2;

            } else {
                vsize += stationAddPersonNumData.getAddPersonNum();

            }
            UnitCache.stationAddPersonNumDataMap.put(sceneCode, null);

        }


        return vsize;
    }

}
